package com.gxa.insurance.controller;

import com.gxa.insurance.service.AttachmentImageService;
import com.gxa.insurance.util.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Min
 */
@Api(value = "订单图片附件相关的api接口")
@RestController
@RequestMapping("/attachmentImage")
@CrossOrigin
public class AttachmentImageController {
    @Autowired
    private AttachmentImageService attachmentImageService;

    @ApiOperation("添加订单图片附件")
    @PostMapping("/insert")
    public Map insertOrderImageByNumber(String number, String imagPath) throws Exception {
        Integer insert = attachmentImageService.insertOrderImageByNumber(number, imagPath);
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("200");
        jsonResult.setData(insert);
        return jsonResult.getMap();
    }


}
